import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class DateTimeTest {

  public static void main(String[] args) {
    System.out.println(new Date(1556705433980L));

    String routerIp = "192.168.2.1";

    System.out.println(routerIp.lastIndexOf(".1"));
    System.out.println(routerIp.length());
    System.out.println(routerIp.lastIndexOf(".1") == routerIp.length() - 2);

    Map<String, String> m = new HashMap<String, String>();

    Stream<String> ss = Stream.of("1", "2", "3");

    String result = ss.collect(Collectors.joining(","));
    System.out.println(result);

    Stream<Person> pp = Stream.of(new Person("a"), new Person("b"));

    pp.collect(Collectors.toCollection(ArrayList::new));

  }

}

class Person {

  String name;

  public Person(String name) {
    this.name = name;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }
}
